package com.itboye.sunsun.login.ui;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

import com.itboye.sunsun.R;
import com.itboye.sunsun.network.LoginNetWork;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.EditText;
import android.widget.Toast;

public class RegistActivity extends Activity {

	
	
	private EditText phoneEdit;
	private EditText yzmEdit;
	private EditText passwordEdit;
	private EditText inviteEdit;
	private String username;
	private String yzm;
	private String password;
	private String invite;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_regist);
		initView();
		initData();
		
	}

	 
	
	public void initView() {
		
		
		phoneEdit=(EditText) findViewById(R.id.phone);
		yzmEdit=(EditText) findViewById(R.id.yzm);
		passwordEdit=(EditText) findViewById(R.id.password);
		inviteEdit=(EditText) findViewById(R.id.invite);
	}
	public void initData()
	{
		username=phoneEdit.getText().toString();
		password=passwordEdit.getText().toString();
		yzm=yzmEdit.getText().toString();
		invite=inviteEdit.getText().toString();
		
		
		Pattern p = Pattern
				.compile("^((13[0-9])|(17\\d)|(14\\d)|(15[^4,\\D])|(18[0-9]))\\d{8}$");
		Matcher m = p.matcher(username);
		if (!m.matches()) {
			Toast.makeText(RegistActivity.this, "请输入正确的手机号", 0).show();
		} 
	}
}
